<template>
  <PageMaking
    ref="pageMakingRef"
    :config="config"
    v-model="data"
  />
</template>

<script setup lang="tsx">
import { onMounted, ref } from 'vue'
import { useRoute, onBeforeRouteUpdate } from 'vue-router'

const route = useRoute()
const code = ref(route.params.code as string)
const data = ref({})

onBeforeRouteUpdate((to, from) => {
  code.value = to.params.code as string
})

const config = ref({})

fetch('/test.json')
  .then(res => res.json())
  .then(data => {
    config.value = data
  })
  
</script>

<style scoped lang="less">
</style>